//下拉列表
var NewNavListContentArray = [], NewNavShowInterval;
function HidNewNavDiv(){
var div = $("newNavContent1");
div.style.display = "none";
return;
}
function NewNavInit()
{
if(!$('newnav')){
return;
}
if( !$("newNavContent") ){
var div = document.createElement('DIV');
div.id = 'newNavContent';
div.innerHTML = '<div id="newNavContent1" style="position:absolute; z-index:9999; width:445px; left:68px; top:0px; display:none;"></div>';
var bs = document.getElementsByTagName('BODY');
bs[0].appendChild(div);
var div = $("newNavContent1");
div.onmouseout = function(){
NewNavShowInterval = setTimeout("HidNewNavDiv();",500);
//this.style.display = "none";
}
div.onmouseover = function(){
clearTimeout(NewNavShowInterval);
this.style.display = "";
}
}
var objWhere = GetObjShowWhereByObj($("newNavContent"));
var a = $('newnav').getElementsByTagName("LI");
a[abroad].onmouseover = function(){
NewNavInitData(this,abroad);
clearTimeout(NewNavShowInterval);
return;
}
a[abroad].onmouseout = function(){
NewNavShowInterval = setTimeout("HidNewNavDiv();",500);
return;
}
a[domestic].onmouseover = function(){
NewNavInitData(this,domestic);
clearTimeout(NewNavShowInterval);
return;
}
a[domestic].onmouseout = function(){
NewNavShowInterval = setTimeout("HidNewNavDiv();",500);
return;
}
a[around].onmouseover = function(){
NewNavInitData(this,around);
clearTimeout(NewNavShowInterval);
return;
}
a[around].onmouseout = function(){
NewNavShowInterval = setTimeout("HidNewNavDiv();",500);
return;
}
return;
}
NewNavInitData = function(obj, type){
if( !NewNavListContentArray[type] ){
var topArray, moreSecArray, moreThiArray;
try{
if(!AreasOfCategory){
return;
}
}catch(e){
return;
}
switch(type){
case 1: //出境
topArray = AreasOfCategory[0];
moreSecArray = AreasOfAbroad;
moreThiArray = AreasOfAbroadList;
break;
case 2://国内
topArray = AreasOfCategory[1];
moreSecArray = AreaOfDomestic;
moreThiArray = AreaOfDomesticList;
break;
case 3://周边
topArray = AreasOfCategory[2];
moreSecArray = AreaNearShenzhen;
moreThiArray = AreaNearShenzhenList;
break;
default:
return;
break;
}
if(hostAreaCode==""){
hostAreaCode = "sz";
}
var hostUrl = "http://"+hostAreaCode+".landtu.com";
var area_code_where = 0;
switch(hostAreaCode){
case "sz":
area_code_where = 0;
break;
case "gz":
area_code_where = 1;
break;
default:
return;
break;
}
var tempArray , checkTempArray;
tempArray = [];
checkTempArray = moreSecArray;
for(var i=0; i<checkTempArray.length; i++){
if(checkTempArray[i][3]=="1"){
continue;
}
if(checkTempArray[i][4].substr(area_code_where,1)!="1"){
continue;
}
tempArray.push( checkTempArray[i] );
}
moreSecArray = tempArray;
tempArray = [];
checkTempArray = moreThiArray;
for(var i=0; i<checkTempArray.length; i++){
if(checkTempArray[i][3]=="1"){
continue;
}
if(checkTempArray[i][4].substr(area_code_where,1)!="1"){
continue;
}
tempArray.push( checkTempArray[i] );
}
moreThiArray = tempArray;
var widthString = "", ulWidthString = "";
switch(type){
case 1:
widthString = '';
break;
case 2:
//widthString = 'width:290PX;';
//ulWidthString = 'width:260PX;';
break;
case 3:
//widthString = 'width:290PX;';
//ulWidthString = 'width:260PX;';
break;
/*
case 3:
widthString = 'width:260PX;';
ulWidthString = 'width:230PX;';
break;
*/
}
var tempString = '';
tempString += '<div id="navlist"';
if(widthString!=""){
tempString += ' style="'+widthString+'"';
}
tempString += '>';
tempString += '<div class="top"><a href="' + hostUrl + topArray[2] + '">'+topArray[1]+'</a></div>';
tempString += '<div class="navlist"';
if(widthString!=""){
tempString += ' style="'+widthString+'"';
}
tempString += '>';
tempString += '<ul';
if(ulWidthString!=""){
tempString += ' style="'+ulWidthString+'"';
}
tempString += '>';
for(var i=0; i<moreSecArray.length; i++){
var ForTempString = "";
for(var j=0; j<moreThiArray.length; j++){
if(moreSecArray[i][0]!=moreThiArray[j][0].substr(0,4)){
continue;
}
if(ForTempString!=""){
ForTempString += "&nbsp;&nbsp;|&nbsp;&nbsp;";
}
ForTempString += '<a href="' + hostUrl + moreThiArray[j][2] + '">' + moreThiArray[j][1] + '</a>';
}
ForTempString = "<span>"+ForTempString+"</span>";
tempString += '<li';
tempString += ' style="';
if(i == moreSecArray.length-1){
tempString += ' border:0 none;';
}
if(ulWidthString!=""){
tempString += ulWidthString;
}
tempString += '"';
tempString += '>';
if(moreSecArray[i][6]!="1"){
tempString += '<strong><a href="' + hostUrl + moreSecArray[i][2] + '">' + moreSecArray[i][1] + '</a></strong>';
}else{
tempString += '<strong>' + moreSecArray[i][1] + '</strong>';
}
tempString += ForTempString;
tempString += '</li>';
}
tempString += '</ul>';
tempString += '</div>';
tempString += '<div class="bl"></div><div class="br"></div>';
tempString += '</div>';
NewNavListContentArray[type] = tempString;
}
$("newNavContent1").innerHTML = NewNavListContentArray[type];
var objWhere = GetObjShowWhereByObj(obj);
var NavContentObjWhere = GetObjShowWhereByObj($("newNavContent"));
var navObjWhere = GetObjShowWhereByObj($("newnav"));
var div = $("newNavContent1");
var t = 0, l = 0;
if( type == UrlWhere ){
t = 4;
l = -2;
}
div.style.display= '';
div.style.left = objWhere.left - navObjWhere.left - l + "px";
div.style.top = objWhere.top - NavContentObjWhere.top - t + 36 + "px";
return;
} 